<html>
<head>

<?php
    $walkName = $_GET['walkName'];
    $walkDescription = $_GET['walkDescription'];
    $walkLink = $_GET['walkLink'];
    $userName = $_GET['userName'];
    $location = $_GET['location'];
    $city = $_GET['city'];
?>
	
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<!--script src="http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="timepicker.js"></script>
<link type="text/css" href="ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" /-->

<script type="text/javascript" charset="utf-8">
	//Make sure the page has completely loaded before loading any jS
	jQuery.noConflict();
	var $j = jQuery;
    $j(function(){
		   $j('#submit').click(function () {          
		         //Get the data from all the fields  
		         var walkName = $j('input[name=walkName]'); 
		         var description = $j('textarea[name=walkDescription]');
		         var location = $j('input[name=location]');
				 var city = $j('input[name=city]');
                 var userName = $j('input[name=userName]');
                 var startdatetime = $j('input[name=startdatetime]');
    			 var enddatetime = $j('input[name=enddatetime]');
    			 		  
						 var data = 'name=' + walkName.val() + '&description='  + encodeURIComponent(description.val()) + '&location=' + encodeURIComponent(description.val()) + '&city=' + encodeURIComponent(city.val()) + '&userName=' + userName.val() +'&starttime=' + startdatetime.val() + '&endtime=' + enddatetime.val() ;
						    $j('#eventForm').html('<strong>Please wait ...</strong>');
						    //start the ajax  
						         $j.ajax({  
						             //this is the php file that processes the data and send mail  
						             url: "event.php",   
						               
						             //GET method is used  
						             type: "GET",  
						   
						             //pass the data           
						             data: data,       
						               
						             //Do not cache the page  
						             cache: false,  
						               
						             //success  
						             success: function (html) {
						                 //alert(html);
						                 //if process.php returned 1/true (send mail success)  
					                     $j('.form').fadeOut('slow');                   
					                     $j('#eventForm').html('<strong>Event invite sent successfully!!</strong>');
					                 }         
						         });
										 
						
						return false;
						
						
		});
	});
</script>
</head>

<body>
	<div id="eventForm" >
		<form method="post" action="process.php" class="form">  
    			<table>
					<tr>
						<td> Name of the Walk:</td>
						<td><input type="text" name="walkName" class="text" value="<?php echo $walkName;?>"/></td>
					</tr>
					<tr>
						<td> Description: </td>
						<td><textarea name="walkDescription" cols=18 rows=6 class="text textarea"><?php echo $walkDescription?>
						    <?php echo $walkLink?></textarea></td>
					</tr>
					<input type="hidden" name="location" class="text" value="<?php echo $location;?>" />
					<input type="hidden" name="city" class="text" value="<?php echo $city;?>" />
					<input type="hidden" name="userName" value="<?php echo $userName;?>" />
					<tr>
                        <td>Start Date and Time:</td>
                        <td><input type="text" name="startdatetime" id="startdatetime" value="MM-DD-YYYY-HH-MM" /></td>
                    </tr>
                    <tr>
                        <td>End Date and Time: </td>
                        <td><input type="text" name="enddatetime" id="enddatetime" value="MM-DD-YYYY-HH-MM" /></td>
                    </tr>
					<tr>
						<td><input type="submit" id="submit" value="Create"/> </td>
					</tr>
				</table>
     </form>
</div>
</body>
</html>
